package day06;
import java.util.Arrays;
import java.util.Scanner;
public class BasicPractice {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);


        speak();
        say("蔡徐坤",24);
        int sum=plus(20,50);
        System.out.println(sum);

        System.out.println("请输入第一个数：");
        int a=scan.nextInt();
        System.out.println("请输入第二个数：");
        int b=scan.nextInt();
        int sum1=plus(a,b);
        System.out.println(sum1);

        double c=num();
        System.out.println(c);

        int [] arr=array(a,b);
        for(int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        /*

        int []arr2=new int[5];
        for(int i=0;i<arr2.length;i++){
            arr2[i]=(int)(Math.random()*100);
        }
        int max=arr2[0];
        for(int i=1;i<arr2.length;i++){
            if(arr2[i]>max){
                max=arr2[i];
            }
        }
        arr2= Arrays.copyOf(arr2,arr2.length+1);//扩容
        arr2[arr2.length-1]=max;
        for(int i= 0;i<arr2.length;i++){
            System.out.println(arr2[i]);
        }

         */


    }
    public static void speak(){
        System.out.println("hello world");
    }
    public static void say(String name,int age){
        System.out.println("我叫"+name+"，我今年"+age+"岁了");
    }
    public static int plus(int num1,int num2){
        int num=num1+num2;
        return num;
    }
    public static double num(){
        return 1.11111;
    }
    public static int[] array(int length,int max){
        int []arr=new int[length];
        for(int i=0;i< arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
        return arr;
    }
}
